//
//  tianjiayigeView.swift
//  SwitfTest
//
//  Created by runone02 on 2019/1/7.
//  Copyright © 2019年 liqiyun. All rights reserved.
//

import UIKit

class tianjiayigeView: UIView {

    //初始化
    override init(frame: CGRect) {
        super.init(frame: frame)
        //设置背景为灰色
        self.backgroundColor = UIColor.gray
    }
    //自动布局
    override func layoutSubviews() {
        let aview = UIView()
        aview.backgroundColor = UIColor.red
        self.addSubview(aview)
        aview.mas_makeConstraints { (make) in
            make?.top.mas_equalTo()(self)
            make?.left.mas_equalTo()(self)
            make?.bottom.mas_equalTo()(self)
            make?.right.mas_equalTo()(self)
        }
    
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    

}
